const settings = require('./src/settings.js')
const title = settings.title || '奇思笔记'

module.exports = {
  // publicPath: './',
  publicPath: process.env.NODE_ENV === 'production' ? `/${settings.pagesRepo}/` : './',
  chainWebpack: config => {
    config.plugin('html').tap(args => {
      args[0].title = title
      return args
    })
  },
  configureWebpack: config => {
    if (process.env.NODE_ENV === 'production') {
      config.mode = 'production'
      //打包文件大小配置
      config['performance'] = {
        maxEntrypointSize: 10000000,
        maxAssetSize: 30000000
      }
    }
  },
  devServer: {
    // proxy: 'http://localhost:3000'
  },
  // plugins: {
  //   '@vssue/vuepress-plugin-vssue': {
  //     // 设置 `platform` 而不是 `api`
  //     platform: 'gitee',

  //     // 其他的 Vssue 配置
  //     owner: settings.commentOptions.owner,
  //     repo: settings.commentOptions.repo,
  //     clientId: settings.commentOptions.clientId,
  //     clientSecret: settings.commentOptions.clientSecret,
  //   },
  // },
}
